import actionTypes from "../action/actionTypes";

export default function roleReducer(preState=[],action){
  switch(action.type){
    case actionTypes.LOAD_ROLE_LIST:
      return action.payload
    case actionTypes.ADD_ROLE:
      return [action.payload,...preState]
    default: 
      return preState
  }
}